-
Notifications
You must be signed in to change notification settings - Fork 233
chore(compass-e2e-tests): add assistant end to end tests COMPASS-9748 #7429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive end-to-end tests for the MongoDB Assistant feature in Compass. The tests cover various scenarios including AI feature opt-in flow, message sending, drawer interactions, and entry points from explain plans and error messages.
- Adds complete e2e test suite for Assistant functionality with 593 lines of test code
- Implements mock assistant service to simulate AI responses with streaming support
- Adds necessary test selectors and data-testid attributes for UI elements
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
packages/compass-generative-ai/src/components/ai-optin-modal.tsx | Adds data-testid for testing the AI opt-in modal |
packages/compass-e2e-tests/tests/assistant.test.ts | Complete test suite covering assistant drawer, opt-in flow, messaging, and entry points |
packages/compass-e2e-tests/helpers/selectors.ts | Adds selectors for assistant UI elements and AI settings |
packages/compass-e2e-tests/helpers/assistant-service.ts | Mock service implementation for simulating assistant API responses |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Assigned |
newValue === false | ||
) { | ||
// Reseting the opt-in to false can be tricky so it's best to start over in this case. | ||
compass = await init(this.test?.fullTitle(), { firstRun: false }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably want to try cleanup(compass);
before making a new one?
const collectionName = 'entryPoints'; | ||
|
||
before(async function () { | ||
skipForWeb(this, 'ai assistant not yet available in compass-web'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't this true, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow I fully missed this AI-coded bit after so many looks 🙈
Adds e2e tests to the core assistant features.